package com.all.play.mymvptwo.presenter;

import java.lang.ref.WeakReference;

/**
 * Created by 聪明一只哈 on 2018/5/16.
 * Time: 2018/5/16  13:05
 */

public class BasePresenter<T> {

    protected WeakReference<T> mView;

    /**
     * 弱引用不是最好的优化方式
     * 以下才是
     * 绑定--->v与p之间的绑定
     */

    //手动进行绑定
    public void attachView(T view){
        mView=new WeakReference<T>(view);
    }

    //手动进行解绑
    public void detachView(){
        mView.clear();
    }



}
